@arcgis/core 4.33.0-next.20250210 → 4.33.0-next.20250212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AttributeBinsGraphic.js +1 -1
- package/Graphic.js +1 -1
- package/Ground.js +1 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/Guid.js +1 -1
- package/arcade/featureset/support/cache.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
- package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
- package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
- package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
- package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
- package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 1249fd2f83caeaefd8ce.js} +1 -1
- package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
- package/assets/esri/core/workers/chunks/{946a9890f3621d1dfbc5.js → 144e534d4ac1aafab60d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
- package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → 17213c3fc63f580e5b73.js} +1 -1
- package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
- package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
- package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
- package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
- package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
- package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
- package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
- package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
- package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
- package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
- package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
- package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
- package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 37cfd102b6ab5b959f9d.js} +1 -1
- package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
- package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
- package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +314 -0
- package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
- package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 3ebdd0701e77bb28c75d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
- package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
- package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
- package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
- package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
- package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
- package/assets/esri/core/workers/chunks/52f61e1f5972a72b6b54.js +1 -0
- package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
- package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
- package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
- package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
- package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
- package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
- package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
- package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → 6518954889df2e781c47.js} +2 -2
- package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
- package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 6fa1f1e431aae1794ce3.js} +1 -1
- package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
- package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
- package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
- package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
- package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
- package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
- package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
- package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
- package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
- package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
- package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
- package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
- package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
- package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
- package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
- package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
- package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
- package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
- package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
- package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
- package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
- package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
- package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
- package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
- package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
- package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
- package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
- package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
- package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
- package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
- package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → b83151b03bbeba466f82.js} +2 -2
- package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +1 -0
- package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → c061cad8323f0469e7e4.js} +1 -1
- package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
- package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
- package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
- package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
- package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
- package/assets/esri/core/workers/chunks/cc8eb975a543556f88ae.js +1 -0
- package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
- package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
- package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
- package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
- package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
- package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d7b260d6187f29e0c136.js} +1 -1
- package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
- package/assets/esri/core/workers/chunks/de87009542886fad9a2f.js +2 -0
- package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
- package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
- package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +1 -0
- package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
- package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
- package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
- package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
- package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
- package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.js +1 -0
- package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → f0d28fe4deb7cd894765.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
- package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
- package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
- package/assets/esri/core/workers/chunks/{140d0c4285c6978103ea.js → f5ce6af342c02a4b0d15.js} +7 -7
- package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/_core.scss +4 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
- package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Bufferer-B-V7yYm-.js +5 -0
- package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
- package/chunks/Envelope.js +1 -1
- package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +2 -4
- package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/distanceOperator.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/core/Accessor.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Logger.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/RandomLCG.js +1 -1
- package/core/XHRAdapter.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/pbf.js +1 -1
- package/core/sql/UnknownTimeZone.js +1 -1
- package/core/sql.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
- package/editing/sharedTemplates/SharedTemplate.js +1 -1
- package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
- package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
- package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
- package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
- package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
- package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/initNoPeFactory.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/UCharArray.js +5 -0
- package/geometry/support/UShortArray.js +5 -0
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Mat3.js +1 -1
- package/geometry/support/buffer/internals/Mat4.js +1 -1
- package/geometry/support/buffer/internals/Scalar.js +1 -1
- package/geometry/support/buffer/internals/Vec2.js +1 -1
- package/geometry/support/buffer/internals/Vec3.js +1 -1
- package/geometry/support/buffer/internals/Vec4.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
- package/identity/OAuthInfo.js +1 -1
- package/interfaces.d.ts +124 -68
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/PublishableLayer.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/save/utils.js +1 -1
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/CodedValueDomain.js +1 -1
- package/layers/support/Field.js +1 -1
- package/layers/support/ImageElement.js +1 -1
- package/layers/support/InheritedDomain.js +1 -1
- package/layers/support/LOD.js +1 -1
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/LabelExpressionInfo.js +1 -1
- package/layers/support/OrderByInfo.js +1 -1
- package/layers/support/PurgeOptions.js +1 -1
- package/layers/support/RangeDomain.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/commonProperties.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/layers/support/source/DataLayerSource.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/networks/Network.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +3 -3
- package/portal/Portal.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/ClosestFacilityParameters.js +1 -1
- package/rest/support/DirectionLine.js +1 -1
- package/rest/support/DirectionPoint.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/NetworkFeatureSet.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/PolygonBarrier.js +1 -1
- package/rest/support/PolylineBarrier.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/Stop.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/ExtrudeSymbol3DLayer.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PathSymbol3DLayer.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/symbols/cim/OverrideHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/support/ElevationInfo.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/DisplayEntity.js +1 -1
- package/views/2d/engine/webgl/DisplayRecord.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/support/HighlightCounter.js +1 -1
- package/views/2d/tiling/TileCoverage.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/SceneViewEnvironment.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsCorePerformanceInfo.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/support/QualitySettings.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/drawSurfaces.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Parameters.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Environment.js +1 -1
- package/webscene/SunLighting.js +1 -1
- package/webscene/VirtualLighting.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +5 -0
- package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/modelUploadUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
- package/widgets/Widget.js +1 -1
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
- package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
- package/assets/esri/core/workers/chunks/08c4b585290efc98ca5d.js +0 -1
- package/assets/esri/core/workers/chunks/117e7a12af77c761efb5.js +0 -1
- package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
- package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
- package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
- package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
- package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
- package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
- package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
- package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
- package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
- package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
- package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
- package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
- package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
- package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
- package/assets/esri/core/workers/chunks/5be7cf1564e756c24066.js +0 -1
- package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
- package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
- package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
- package/assets/esri/core/workers/chunks/6d79ec15d1858839f576.js +0 -1
- package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
- package/assets/esri/core/workers/chunks/7966c245a073c85f04b1.js +0 -1
- package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
- package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
- package/assets/esri/core/workers/chunks/8bd51b5b392dfacc922f.js +0 -1
- package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
- package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
- package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
- package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
- package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
- package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
- package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
- package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
- package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
- package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
- package/assets/esri/core/workers/chunks/c249ad935f54d3b49ae3.js +0 -1
- package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
- package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
- package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
- package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
- package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
- package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
- package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
- package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
- package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
- package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
- package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
- package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
- package/assets/esri/core/workers/chunks/faf9063420262ea40fd8.js +0 -1
- package/chunks/Bufferer-DjC-SKTJ.js +0 -5
- package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
- package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{GeometryType as i,Point as s}from"../../../../../geometry/support/TileClipper.js";import{BucketType as a}from"../enums.js";import{cDegToRad as o,log2 as r,interpolate as l}from"../GeometryUtils.js";import{tilePixelRatio as h,Anchor as x,tileCoordSize as c}from"../Placement.js";import{sdfGlyphSize as d,TextShaping as f}from"../TextShaping.js";import g from"./BaseBucket.js";import{TextTransform as y,SymbolPlacement as m,RotationAlignment as u,TextWritingMode as p,SymbolAnchor as _,TextJustification as M}from"../style/StyleDefinition.js";import{IconLayout as P,TextLayout as I}from"../style/StyleLayer.js";const b=10;function A(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class L extends g{constructor(e,t,n,i,s,o,r,l,h){super(t,n,h.getSpriteItems()),this.type=a.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,i){const s=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=s.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=s.getLayoutValue("text-font",a),h=null);for(const m of this._features){const u=m.getGeometry(e);if(!u||0===u.length)continue;let p,_;o&&(p=o.isDataDriven?o.getValue(a,m):this._replaceKeys(c,m.values),p&&t(p));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,m):this._replaceKeys(d,m.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,m)),f){case y.LOWERCASE:_=_.toLowerCase();break;case y.UPPERCASE:_=_.toUpperCase()}if(L._bidiEngine.hasBidiChar(_)){let e;e="rtl"===L._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=L._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,m));for(const e of g){let t=i[e];t||(t=i[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!p&&!_)continue;const P=s.getLayoutValue("symbol-sort-key",a,m),I={feature:m,sprite:p,label:_,rtl:M,geometry:u,hash:(_?n(_):0)^(p?n(p):0),priority:P,textFont:g};x.push(I)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,a=n.getLayoutValue("symbol-placement",s),r=a!==m.POINT,l=n.getLayoutValue("symbol-spacing",s)*h,g=n.getLayoutProperty("icon-image"),y=n.getLayoutProperty("text-field"),b=g?new P(n,s,r):null,T=y?new I(n,s,r):null,V=this._workerTileHandler;let w;g&&(w=V.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const B=[];let C=1;T?.size&&(C=T.size/d);const R=T?T.maxAngle*o:0,D=T?T.size*h:0;for(const o of this._symbolFeatures){let e;b&&w&&o.sprite&&(e=w[o.sprite],e&&e.sdf&&(this._isIconSDF=!0));let n;!!e&&b.update(s,o.feature);let g=0;const y=o.label;if(y){t(T),T.update(s,o.feature);const e=r&&T.rotationAlignment===u.MAP?T.keepUpright:T.writingMode&&T.writingMode.includes(p.VERTICAL);let i=.5;switch(T.anchor){case _.TOP_LEFT:case _.LEFT:case _.BOTTOM_LEFT:i=0;break;case _.TOP_RIGHT:case _.RIGHT:case _.BOTTOM_RIGHT:i=1}let a=.5;switch(T.anchor){case _.TOP_LEFT:case _.TOP:case _.TOP_RIGHT:a=0;break;case _.BOTTOM_LEFT:case _.BOTTOM:case _.BOTTOM_RIGHT:a=1}let l=.5;switch(T.justify){case M.AUTO:l=i;break;case M.LEFT:l=0;break;case M.RIGHT:l=1}const x=T.letterSpacing*d,c=r?0:T.maxWidth*d,m=T.lineHeight*d,P=o.textFont.map((e=>V.getGlyphItems(e)));if(n=new f(P,c,m,x,i,a,l).getShaping(y,o.rtl,e),n&&n.length>0){let e=1e30,t=-1e30;for(const i of n)e=Math.min(e,i.x),t=Math.max(t,i.x);g=(t-e+2*d)*C*h}}for(let t of o.geometry){const s=[];if(a===m.LINE){if(n?.length&&T?.size){const e=T.size*h*(2+Math.min(2,4*Math.abs(T.offset[1])));t=L._smoothVertices(t,e)}L._pushAnchors(s,t,l,g)}else a===m.LINE_CENTER?L._pushCenterAnchor(s,t):o.feature.type===i.Polygon?L._pushCentroid(s,t):s.push(new x(t[0].x,t[0].y));for(const i of s){if(i.x<0||i.x>c||i.y<0||i.y>c)continue;if(r&&g>0&&T?.rotationAlignment===u.MAP&&!L._honorsTextMaxAngle(t,i,g,R,D))continue;const s={shaping:n,line:t,iconMosaicItem:e,anchor:i,symbolFeature:o,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};B.push(s),this._processFeature(s,b,T)}}}B.sort(A),this._addPlacedGlyphs(),this._symbolInstances=B}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=L._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),i=new Float32Array(t.buffer),[s,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(s),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=L.serializeSymbols(t,n,i,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=b;for(const e of n.iconColliders)t+=b;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,i,s){s=s||[],t[i++]=s.length;for(const a of s){t[i++]=a.anchor.x,t[i++]=a.anchor.y,t[i++]=a.symbolFeature.hash,t[i++]=a.symbolFeature.priority,t[i++]=a.symbolFeature.feature.featureIndex,t[i++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;for(const e of a.iconColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;t[i++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[i++]=e,t[i++]=n;t[i++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[i++]=e,t[i++]=n}return i}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,n)=>n in t?t[n]:""))}_processFeature(e,t,n){const{line:i,iconMosaicItem:s,shaping:a,anchor:o}=e,l=this.zoom,h=this.layer,x=!!s;let c=!0;x&&(c=t?.optional||!s);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,s,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,i,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,s.page,t.rotationAlignment===u.VIEWPORT,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,i,s,a){const o=Math.max(n-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=s?0:Math.max(n+r(c.minzoom),o),d=s?25:Math.min(n+r(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,P=c.anchor,I=l.index,b=u.x,A=u.y,L=b+u.width,T=A+u.height,V=l.index;l.add(P.x,P.y,f.x,f.y,b,A,p,_,M,t,d,a),l.add(P.x,P.y,g.x,g.y,L,A,p,_,M,t,d,a),l.add(P.x,P.y,y.x,y.y,b,T,p,_,M,t,d,a),l.add(P.x,P.y,m.x,m.y,L,T,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===V?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([V,4]),h.add(I,I+1,I+2),h.add(I+1,I+2,I+3),x.has(i)?x.get(i)[1]+=6:x.set(i,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[i,s]of this._glyphBufferDataStorage)for(const a of s){const s=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(s,s+1,s+2),t.add(s+1,s+2,s+3),n.has(i)?n.get(i)[1]+=6:n.set(i,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,i,s){const a=Math.max(n-1,0),o=i===u.VIEWPORT;let l,h,x,c,d,f,g,y,m,p,_;for(const u of t){if(l=o?0:Math.max(n+r(u.minzoom),a),h=o?25:Math.min(n+r(u.maxzoom),25),h<=l)continue;x=u.tl,c=u.tr,d=u.bl,f=u.br,g=u.labelAngle,y=u.minAngle,m=u.maxAngle,p=u.anchor,_=u.mosaicRect,this._glyphBufferDataStorage.has(u.page)||this._glyphBufferDataStorage.set(u.page,[]);this._glyphBufferDataStorage.get(u.page).push({glyphAnchor:[p.x,p.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:l,maxLod:h,placementLod:a,symbolInstance:e,ddAttributes:s})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let l=0;l<o;l++)a+=s.distance(t[l],t[l+1]);let r=i||n;if(r*=.5,a<=r)return;const h=r/a;let c=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<c+f;){d+=n;const t=(d-c)/f,y=l(i.x,a.x,t),m=l(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new x(y,m,g,s,h))}c+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,h=i.y-n.y,c=Math.sqrt(r*r+h*h);if(a<o+c){const t=(a-o)/c,d=l(n.x,i.x,t),f=l(n.y,i.y,t),g=Math.atan2(h,r);return void e.push(new x(d,f,g,s,0))}o+=c}}static _deviation(e,t,n){const i=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),s=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(s,i)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _pushCentroid(e,t){const n=0,i=0,s=4096,a=4096,o=t.length-1;let r=0,l=0,h=0,c=t[0].x,d=t[0].y;c>s&&(c=s),c<n&&(c=n),d>a&&(d=a),d<i&&(d=i);for(let x=1;x<o;x++){let e=t[x].x,o=t[x].y,f=t[x+1].x,g=t[x+1].y;e>s&&(e=s),e<n&&(e=n),o>a&&(o=a),o<i&&(o=i),f>s&&(f=s),f<n&&(f=n),g>a&&(g=a),g<i&&(g=i);const y=(e-c)*(g-d)-(f-c)*(o-d);r+=y*(c+e+f),l+=y*(d+o+g),h+=y}r/=3*h,l/=3*h,isNaN(r)||isNaN(l)||e.push(new x(r,l))}}L._bidiEngine=new e;export{L as default};
|
|
5
|
+
import e from"../../../../../core/BidiEngine.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{numericHash as n}from"../../../../../core/string.js";import{GeometryType as i,Point as s}from"../../../../../geometry/support/TileClipper.js";import{BucketType as a}from"../enums.js";import{cDegToRad as o,log2 as r,interpolate as l}from"../GeometryUtils.js";import{tilePixelRatio as h,Anchor as x,tileCoordSize as c}from"../Placement.js";import{sdfGlyphSize as d,TextShaping as f}from"../TextShaping.js";import g from"./BaseBucket.js";import{TextTransform as y,SymbolPlacement as m,RotationAlignment as u,TextWritingMode as p,SymbolAnchor as _,TextJustification as M}from"../style/StyleDefinition.js";import{IconLayout as P,TextLayout as I}from"../style/StyleLayer.js";const b=10;function A(e,t){return e.iconMosaicItem&&t.iconMosaicItem?e.iconMosaicItem.page===t.iconMosaicItem.page?0:e.iconMosaicItem.page-t.iconMosaicItem.page:e.iconMosaicItem&&!t.iconMosaicItem?1:!e.iconMosaicItem&&t.iconMosaicItem?-1:0}class L extends g{constructor(e,t,n,i,s,o,r,l,h){super(t,n,h.getSpriteItems()),this.type=a.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=e,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}static{this._bidiEngine=new e}getResources(e,t,i){const s=this.layer,a=this.zoom;e&&e.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const x=[];let c,d,f,g;o&&!o.isDataDriven&&(c=o.getValue(a)),r&&!r.isDataDriven&&(d=r.getValue(a)),l&&l.isDataDriven||(f=s.getLayoutValue("text-transform",a),l=null),h&&h.isDataDriven||(g=s.getLayoutValue("text-font",a),h=null);for(const m of this._features){const u=m.getGeometry(e);if(!u||0===u.length)continue;let p,_;o&&(p=o.isDataDriven?o.getValue(a,m):this._replaceKeys(c,m.values),p&&t(p));let M=!1;if(r&&(_=r.isDataDriven?r.getValue(a,m):this._replaceKeys(d,m.values),_)){switch(_=_.replaceAll("\\n","\n"),l&&(f=l.getValue(a,m)),f){case y.LOWERCASE:_=_.toLowerCase();break;case y.UPPERCASE:_=_.toUpperCase()}if(L._bidiEngine.hasBidiChar(_)){let e;e="rtl"===L._bidiEngine.checkContextual(_)?"IDNNN":"ICNNN",_=L._bidiEngine.bidiTransform(_,e,"VLYSN"),M=!0}if(_.length>0){h&&(g=h.getValue(a,m));for(const e of g){let t=i[e];t||(t=i[e]=new Set);for(const e of _){const n=e.codePointAt(0);null!=n&&t.add(n)}}}}if(!p&&!_)continue;const P=s.getLayoutValue("symbol-sort-key",a,m),I={feature:m,sprite:p,label:_,rtl:M,geometry:u,hash:(_?n(_):0)^(p?n(p):0),priority:P,textFont:g};x.push(I)}this._symbolFeatures=x}processFeatures(e){e&&e.setExtent(this.layerExtent);const n=this.layer,s=this.zoom,a=n.getLayoutValue("symbol-placement",s),r=a!==m.POINT,l=n.getLayoutValue("symbol-spacing",s)*h,g=n.getLayoutProperty("icon-image"),y=n.getLayoutProperty("text-field"),b=g?new P(n,s,r):null,T=y?new I(n,s,r):null,V=this._workerTileHandler;let w;g&&(w=V.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const B=[];let C=1;T?.size&&(C=T.size/d);const R=T?T.maxAngle*o:0,D=T?T.size*h:0;for(const o of this._symbolFeatures){let e;b&&w&&o.sprite&&(e=w[o.sprite],e&&e.sdf&&(this._isIconSDF=!0));let n;!!e&&b.update(s,o.feature);let g=0;const y=o.label;if(y){t(T),T.update(s,o.feature);const e=r&&T.rotationAlignment===u.MAP?T.keepUpright:T.writingMode&&T.writingMode.includes(p.VERTICAL);let i=.5;switch(T.anchor){case _.TOP_LEFT:case _.LEFT:case _.BOTTOM_LEFT:i=0;break;case _.TOP_RIGHT:case _.RIGHT:case _.BOTTOM_RIGHT:i=1}let a=.5;switch(T.anchor){case _.TOP_LEFT:case _.TOP:case _.TOP_RIGHT:a=0;break;case _.BOTTOM_LEFT:case _.BOTTOM:case _.BOTTOM_RIGHT:a=1}let l=.5;switch(T.justify){case M.AUTO:l=i;break;case M.LEFT:l=0;break;case M.RIGHT:l=1}const x=T.letterSpacing*d,c=r?0:T.maxWidth*d,m=T.lineHeight*d,P=o.textFont.map((e=>V.getGlyphItems(e)));if(n=new f(P,c,m,x,i,a,l).getShaping(y,o.rtl,e),n&&n.length>0){let e=1e30,t=-1e30;for(const i of n)e=Math.min(e,i.x),t=Math.max(t,i.x);g=(t-e+2*d)*C*h}}for(let t of o.geometry){const s=[];if(a===m.LINE){if(n?.length&&T?.size){const e=T.size*h*(2+Math.min(2,4*Math.abs(T.offset[1])));t=L._smoothVertices(t,e)}L._pushAnchors(s,t,l,g)}else a===m.LINE_CENTER?L._pushCenterAnchor(s,t):o.feature.type===i.Polygon?L._pushCentroid(s,t):s.push(new x(t[0].x,t[0].y));for(const i of s){if(i.x<0||i.x>c||i.y<0||i.y>c)continue;if(r&&g>0&&T?.rotationAlignment===u.MAP&&!L._honorsTextMaxAngle(t,i,g,R,D))continue;const s={shaping:n,line:t,iconMosaicItem:e,anchor:i,symbolFeature:o,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};B.push(s),this._processFeature(s,b,T)}}}B.sort(A),this._addPlacedGlyphs(),this._symbolInstances=B}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=L._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),n=new Int32Array(t.buffer),i=new Float32Array(t.buffer),[s,a,o]=this._sourceTileKey.split("/");let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let l=0;l<this.layerUIDs.length;l++)t[r++]=this.layerUIDs[l];t[r++]=this._isIconSDF?1:0,t[r++]=parseFloat(s),t[r++]=parseFloat(a),t[r++]=parseFloat(o),t[r++]=this.markerPageMap.size;for(const[l,[h,x]]of this.markerPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this.glyphsPageMap.size;for(const[l,[h,x]]of this.glyphsPageMap)t[r++]=l,t[r++]=h,t[r++]=x;t[r++]=this._iconVertexBuffer.index/4,t[r++]=this._textVertexBuffer.index/4,r=L.serializeSymbols(t,n,i,r,this._symbolInstances),t[r++]=this._iconVertexBuffer.array.length;for(let l=0;l<this._iconVertexBuffer.array.length;l++)n[r++]=this._iconVertexBuffer.array[l];t[r++]=this._iconIndexBuffer.array.length;for(let l=0;l<this._iconIndexBuffer.array.length;l++)t[r++]=this._iconIndexBuffer.array[l];t[r++]=this._textVertexBuffer.array.length;for(let l=0;l<this._textVertexBuffer.array.length;l++)n[r++]=this._textVertexBuffer.array[l];t[r++]=this._textIndexBuffer.array.length;for(let l=0;l<this._textIndexBuffer.array.length;l++)t[r++]=this._textIndexBuffer.array[l];return t.buffer}static _symbolsSerializationLength(e){let t=0;t+=1;for(const n of e||[]){t+=5,t+=1;for(const e of n.textColliders)t+=b;for(const e of n.iconColliders)t+=b;t+=1,t+=2*n.textVertexRanges.length,t+=1,t+=2*n.iconVertexRanges.length}return t}static serializeSymbols(e,t,n,i,s){s=s||[],t[i++]=s.length;for(const a of s){t[i++]=a.anchor.x,t[i++]=a.anchor.y,t[i++]=a.symbolFeature.hash,t[i++]=a.symbolFeature.priority,t[i++]=a.symbolFeature.feature.featureIndex,t[i++]=a.textColliders.length+a.iconColliders.length;for(const e of a.textColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;for(const e of a.iconColliders)t[i++]=e.xTile,t[i++]=e.yTile,t[i++]=e.dxPixels,t[i++]=e.dyPixels,t[i++]=e.hard?1:0,t[i++]=e.partIndex,n[i++]=e.minLod,n[i++]=e.maxLod,t[i++]=e.width,t[i++]=e.height;t[i++]=a.textVertexRanges.length;for(const[e,n]of a.textVertexRanges)t[i++]=e,t[i++]=n;t[i++]=a.iconVertexRanges.length;for(const[e,n]of a.iconVertexRanges)t[i++]=e,t[i++]=n}return i}_replaceKeys(e,t){return e.replaceAll(/{([^{}]+)}/g,((e,n)=>n in t?t[n]:""))}_processFeature(e,t,n){const{line:i,iconMosaicItem:s,shaping:a,anchor:o}=e,l=this.zoom,h=this.layer,x=!!s;let c=!0;x&&(c=t?.optional||!s);const d=a&&a.length>0,f=!d||n?.optional;let g,y;if(x&&(g=this._placementEngine.getIconPlacement(o,s,t)),(g||c)&&(d&&(y=this._placementEngine.getTextPlacement(o,a,i,n)),y||f)){if(g&&y||(f||c?f||y?c||g||(y=null):g=null:(g=null,y=null)),y){const t=h.hasDataDrivenText?h.textMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(e,y.shapes,l,n.rotationAlignment,t),y.textColliders){e.textColliders=y.textColliders;for(const e of y.textColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}if(g){const n=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(e,g.shapes,l,s.page,t.rotationAlignment===u.VIEWPORT,n),g.iconColliders){e.iconColliders=g.iconColliders;for(const e of g.iconColliders){e.minLod=Math.max(l+r(e.minLod),0),e.maxLod=Math.min(l+r(e.maxLod),25);const t=e.angle;if(t){const n=Math.cos(t),i=Math.sin(t),s=e.dxPixels*n-e.dyPixels*i,a=e.dxPixels*i+e.dyPixels*n,o=(e.dxPixels+e.width)*n-e.dyPixels*i,r=(e.dxPixels+e.width)*i+e.dyPixels*n,l=e.dxPixels*n-(e.dyPixels+e.height)*i,h=e.dxPixels*i+(e.dyPixels+e.height)*n,x=(e.dxPixels+e.width)*n-(e.dyPixels+e.height)*i,c=(e.dxPixels+e.width)*i+(e.dyPixels+e.height)*n,d=Math.min(s,o,l,x),f=Math.max(s,o,l,x),g=Math.min(a,r,h,c),y=Math.max(a,r,h,c);e.dxPixels=d,e.dyPixels=g,e.width=f-d,e.height=y-g}}}}}}_addPlacedIcons(e,t,n,i,s,a){const o=Math.max(n-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,x=this._markerMap;for(const c of t){const t=s?0:Math.max(n+r(c.minzoom),o),d=s?25:Math.min(n+r(c.maxzoom),25);if(d<=t)continue;const f=c.tl,g=c.tr,y=c.bl,m=c.br,u=c.mosaicRect,p=c.labelAngle,_=c.minAngle,M=c.maxAngle,P=c.anchor,I=l.index,b=u.x,A=u.y,L=b+u.width,T=A+u.height,V=l.index;l.add(P.x,P.y,f.x,f.y,b,A,p,_,M,t,d,a),l.add(P.x,P.y,g.x,g.y,L,A,p,_,M,t,d,a),l.add(P.x,P.y,y.x,y.y,b,T,p,_,M,t,d,a),l.add(P.x,P.y,m.x,m.y,L,T,p,_,M,t,d,a),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===V?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([V,4]),h.add(I,I+1,I+2),h.add(I+1,I+2,I+3),x.has(i)?x.get(i)[1]+=6:x.set(i,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,n=this._glyphMap;for(const[i,s]of this._glyphBufferDataStorage)for(const a of s){const s=e.index,o=a.symbolInstance,r=a.ddAttributes,l=e.index;e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tl[0],a.tl[1],a.xmin,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.tr[0],a.tr[1],a.xmax,a.ymin,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.bl[0],a.bl[1],a.xmin,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),e.add(a.glyphAnchor[0],a.glyphAnchor[1],a.br[0],a.br[1],a.xmax,a.ymax,a.labelAngle,a.minAngle,a.maxAngle,a.minLod,a.maxLod,r),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===l?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([l,4]),t.add(s,s+1,s+2),t.add(s+1,s+2,s+3),n.has(i)?n.get(i)[1]+=6:n.set(i,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,n,i,s){const a=Math.max(n-1,0),o=i===u.VIEWPORT;let l,h,x,c,d,f,g,y,m,p,_;for(const u of t){if(l=o?0:Math.max(n+r(u.minzoom),a),h=o?25:Math.min(n+r(u.maxzoom),25),h<=l)continue;x=u.tl,c=u.tr,d=u.bl,f=u.br,g=u.labelAngle,y=u.minAngle,m=u.maxAngle,p=u.anchor,_=u.mosaicRect,this._glyphBufferDataStorage.has(u.page)||this._glyphBufferDataStorage.set(u.page,[]);this._glyphBufferDataStorage.get(u.page).push({glyphAnchor:[p.x,p.y],tl:[x.x,x.y],tr:[c.x,c.y],bl:[d.x,d.y],br:[f.x,f.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:g,minAngle:y,maxAngle:m,minLod:l,maxLod:h,placementLod:a,symbolInstance:e,ddAttributes:s})}}static _pushAnchors(e,t,n,i){n+=i;let a=0;const o=t.length-1;for(let l=0;l<o;l++)a+=s.distance(t[l],t[l+1]);let r=i||n;if(r*=.5,a<=r)return;const h=r/a;let c=0,d=-(n=a/Math.max(Math.round(a/n),1))/2;const f=t.length-1;for(let s=0;s<f;s++){const i=t[s],a=t[s+1],o=a.x-i.x,r=a.y-i.y,f=Math.sqrt(o*o+r*r);let g;for(;d+n<c+f;){d+=n;const t=(d-c)/f,y=l(i.x,a.x,t),m=l(i.y,a.y,t);void 0===g&&(g=Math.atan2(r,o)),e.push(new x(y,m,g,s,h))}c+=f}}static _pushCenterAnchor(e,t){let n=0;const i=t.length-1;for(let l=0;l<i;l++)n+=s.distance(t[l],t[l+1]);const a=n/2;let o=0;const r=t.length-1;for(let s=0;s<r;s++){const n=t[s],i=t[s+1],r=i.x-n.x,h=i.y-n.y,c=Math.sqrt(r*r+h*h);if(a<o+c){const t=(a-o)/c,d=l(n.x,i.x,t),f=l(n.y,i.y,t),g=Math.atan2(h,r);return void e.push(new x(d,f,g,s,0))}o+=c}}static _deviation(e,t,n){const i=(t.x-e.x)*(n.x-t.x)+(t.y-e.y)*(n.y-t.y),s=(t.x-e.x)*(n.y-t.y)-(t.y-e.y)*(n.x-t.x);return Math.atan2(s,i)}static _honorsTextMaxAngle(e,t,n,i,a){let o=0;const r=n/2;let l=new s(t.x,t.y),h=t.segment+1;for(;o>-r;){if(--h,h<0)return!1;o-=s.distance(e[h],l),l=e[h]}o+=s.distance(e[h],e[h+1]);const x=[];let c=0;const d=e.length;for(;o<r;){const t=e[h];let n,r=h;do{if(++r,r===d)return!1;n=e[r]}while(n.isEqual(t));let l,f=r;do{if(++f,f===d)return!1;l=e[f]}while(l.isEqual(n));const g=this._deviation(t,n,l);for(x.push({deviation:g,distToAnchor:o}),c+=g;o-x[0].distToAnchor>a;)c-=x.shift().deviation;if(Math.abs(c)>i)return!1;o+=s.distance(n,l),h=r}return!0}static _smoothVertices(e,t){if(t<=0)return e;let n=e.length;if(n<3)return e;const i=[];let a=0,o=0;i.push(0);for(let y=1;y<n;y++){const t=s.distance(e[y],e[y-1]);t>0&&(a+=t,i.push(a),o++,o!==y&&(e[o]=e[y]))}if(n=o+1,n<3)return e;t=Math.min(t,.2*a);const r=e[0].x,l=e[0].y,h=e[n-1].x,x=e[n-1].y,c=s.sub(e[0],e[1]);c.normalize(),e[0].x+=t*c.x,e[0].y+=t*c.y,c.assignSub(e[n-1],e[n-2]),c.normalize(),e[n-1].x+=t*c.x,e[n-1].y+=t*c.y,i[0]-=t,i[n-1]+=t;const d=[];d.push(new s(r,l));const f=1e-6,g=.5*t;for(let y=1;y<n-1;y++){let a=0,o=0,r=0;for(let n=y-1;n>=0;n--){const s=g+i[n+1]-i[y];if(s<0)break;const l=i[n+1]-i[n],h=i[y]-i[n]<g?1:s/l;if(h<f)break;const x=h*h,c=h*s-.5*x*l,d=h*l/t,m=e[n+1],u=e[n].x-m.x,p=e[n].y-m.y;a+=d/c*(m.x*h*s+.5*x*(s*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*s+.5*x*(s*p-l*m.y)-x*h*l*p/3),r+=d}for(let s=y+1;s<n;s++){const n=g-i[s-1]+i[y];if(n<0)break;const l=i[s]-i[s-1],h=i[s]-i[y]<g?1:n/l;if(h<f)break;const x=h*h,c=h*n-.5*x*l,d=h*l/t,m=e[s-1],u=e[s].x-m.x,p=e[s].y-m.y;a+=d/c*(m.x*h*n+.5*x*(n*u-l*m.x)-x*h*l*u/3),o+=d/c*(m.y*h*n+.5*x*(n*p-l*m.y)-x*h*l*p/3),r+=d}d.push(new s(a/r,o/r))}return d.push(new s(h,x)),e[0].x=r,e[0].y=l,e[n-1].x=h,e[n-1].y=x,d}static _pushCentroid(e,t){const n=0,i=0,s=4096,a=4096,o=t.length-1;let r=0,l=0,h=0,c=t[0].x,d=t[0].y;c>s&&(c=s),c<n&&(c=n),d>a&&(d=a),d<i&&(d=i);for(let x=1;x<o;x++){let e=t[x].x,o=t[x].y,f=t[x+1].x,g=t[x+1].y;e>s&&(e=s),e<n&&(e=n),o>a&&(o=a),o<i&&(o=i),f>s&&(f=s),f<n&&(f=n),g>a&&(g=a),g<i&&(g=i);const y=(e-c)*(g-d)-(f-c)*(o-d);r+=y*(c+e+f),l+=y*(d+o+g),h+=y}r/=3*h,l/=3*h,isNaN(r)||isNaN(l)||e.push(new x(r,l))}}export{L as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{GeometryType as n}from"../../../../../geometry/support/TileClipper.js";import{unitBezier as a}from"../../../unitBezier.js";import{interpolate as o}from"../GeometryUtils.js";import{valueType as i,stringType as l,objectType as u,numberType as c,booleanType as h,colorType as p,typeToString as g,arrayType as f,getType as w,matchType as m,valueToString as y}from"./types.js";class _{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class v{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new v}evaluate(t,e){return t?.id}}class b{constructor(){this.type=l}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new b}evaluate(t,e){if(!t)return null;switch(t.type){case n.Point:return"Point";case n.LineString:return"LineString";case n.Polygon:return"Polygon";default:return null}}}class d{constructor(){this.type=u}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new d}evaluate(t,e){return t?.values}}class x{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new x}evaluate(t,e){return e}}class E{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=h}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new E(pt(t[1],e),pt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class $ extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t===e))}}class M extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t!==e))}}class k extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<e))}}class A extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<=e))}}class j extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>e))}}class q extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>=e))}}class N{constructor(t){this._arg=t,this.type=h}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new N(pt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class C{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class z{constructor(t){this._args=t,this.type=h}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new z(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class I{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=pt(t[o],e),i=pt(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=pt(t[t.length-1],e,r);return s||(s=a.type),new I(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class L{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=pt(t[n],e);r||(r=a.type),s.push(a)}return new L(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class U{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=pt(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=pt(t[i+1],e);r||(r=l.type),n.push(l)}return new U(r,s,a,n,pt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class P{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=pt(t[2],e,c);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=p:r&&"value"!==r.kind&&(o=r);const i=[];for(let l=3;l<t.length;l+=2){const r=t[l];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(i.length&&i[i.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=pt(t[l+1],e,o);o||(o=n.type),i.push([r,n])}if(o&&o!==p&&o!==c&&("array"!==o.kind||o.itemType!==c))throw new Error(`"${s}" cannot interpolate type ${g(o)}`);return new P(s,o,n,a,i)}evaluate(n,a){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,a);const l=this.input.evaluate(n,a);if(l<=i[0][0])return i[0][1].evaluate(n,a);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,a);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],p=P.interpolationRatio(this.interpolation,l,c,h),f=i[u-1][1].evaluate(n,a),w=i[u][1].evaluate(n,a);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(f)&&Array.isArray(w))return f.map(((t,e)=>o(t,w[e],p)));if("color"===this.type.kind&&f instanceof t&&w instanceof t){const e=new t(f),r=new t(w);return new t([o(e.r,r.r,p),o(e.g,r.g,p),o(e.b,r.b,p),o(e.a,r.a,p)])}if("number"===this.type.kind&&"number"==typeof f&&"number"==typeof w)return o(f,w,p);throw new Error(`"${this._operator}" cannot interpolate type ${g(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(f),n=e(w),a=n.h-s.h,i=r({h:s.h+p*(a>180||a<-180?a-360*Math.round(a/360):a),c:o(s.c,n.c,p),l:o(s.l,n.l,p)});return new t({a:o(f.a,w.a,p),...i})}if("interpolate-lab"===this._operator){const e=s(f),n=s(w),a=r({l:o(e.l,n.l,p),a:o(e.a,n.a,p),b:o(e.b,n.b,p)});return new t({a:o(f.a,w.a,p),...a})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return P.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let n=0;if("linear"===t[0])n=P._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])n=P._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){n=a(t[1],t[2],t[3],t[4])(P._exponentialInterpolationRatio(e,1,r,s),1e-5)}return n<0?n=0:n>1&&(n=1),n}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class S{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=pt(t[1],e,c);let s;const n=[];n.push([-1/0,pt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=pt(t[a+1],e);s||(s=o.type),n.push([r,o])}return new S(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class B{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new _(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,pt(t[a+1],e))}const n=pt(t[t.length-1],s,r);return new B(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class T{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new T(r||i,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=pt(t[1],e,c),s=pt(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=i}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new F(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new F(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class G{constructor(t,e){this._key=t,this._obj=e,this.type=h}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new G(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new G(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class V{constructor(t,e){this._key=t,this._vals=e,this.type=h}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new V(pt(t[1],e),pt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class D{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=c}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=pt(t[1],e),s=pt(t[2],e);if(4===t.length){const n=pt(t[3],e,c);return new D(r,s,n)}return new D(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class H{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=pt(t[1],e);return new H(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class J{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=pt(t[1],e),s=pt(t[2],e,c);if(s.type!==c)throw new Error('"slice" index must return a number');if(4===t.length){const n=pt(t[3],e,c);if(n.type!==c)throw new Error('"slice" index must return a number');return new J(r.type,r,s,n)}return new J(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class K{constructor(){this.type=h}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new K}evaluate(t,e){return void 0!==t?.id}}class Q{constructor(t,e){this._args=t,this._calculate=e,this.type=c}static parse(t,e,r){const s=t.slice(1).map((t=>pt(t,e)));return new Q(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class W extends Q{static parse(t,e){switch(t.length){case 2:return Q.parse(t,e,(t=>-t[0]));case 3:return Q.parse(t,e,(t=>t[0]-t[1]));default:throw new Error('"-" expects 1 or 2 arguments')}}}class X extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=1;for(const r of t)e*=r;return e}))}}class Y extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]/t[1]));throw new Error('"/" expects 2 arguments')}}class Z extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]%t[1]));throw new Error('"%" expects 2 arguments')}}class tt extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]**t[1]));throw new Error('"^" expects 1 or 2 arguments')}}class et extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=0;for(const r of t)e+=r;return e}))}}class rt{constructor(t,e){this._args=t,this._calculate=e,this.type=c}static parse(t,e){const r=t.slice(1).map((t=>pt(t,e)));return new rt(r,rt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}rt.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])};class st{constructor(t){this._args=t,this.type=l}static parse(t,e){return new st(t.slice(1).map((t=>pt(t,e))))}evaluate(t,e){return this._args.map((r=>r.evaluate(t,e))).join("")}}class nt{constructor(t,e){this._arg=t,this._calculate=e,this.type=l}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=pt(t[1],e);return new nt(r,nt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}nt.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()};class at{constructor(t){this._args=t,this.type=p}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class ot{constructor(t){this._args=t,this.type=p}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new ot(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class it{constructor(t){this._color=t,this.type=f(c,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=pt(t[1],e);return new it(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class lt{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=l;break;case"number":s=c;break;case"boolean":s=h;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=i;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=f(s,e)}else switch(r){case"string":s=l;break;case"number":s=c;break;case"boolean":s=h;break;case"object":s=u}const a=[];for(;n<t.length;n++){const r=pt(t[n],e);a.push(r)}return new lt(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=w(n),m(r,this.type))return n}throw new Error(`Expected ${g(this.type)} but got ${g(r)}`)}}class ut{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=ut.types[r];if(s===h||s===l){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=pt(t[a],e);n.push(r)}return new ut(s,n)}evaluate(e,r){if(this.type===h)return Boolean(this._args[0].evaluate(e,r));if(this.type===l)return y(this._args[0].evaluate(e,r));if(this.type===c){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===p){for(const s of this._args)try{const n=ut.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return y(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}ut.types={"to-boolean":h,"to-color":p,"to-number":c,"to-string":l};class ct{constructor(t){this._val=t,this.type=w(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ct(t[1])}evaluate(t,e){return this._val}}class ht{constructor(t){this._arg=t,this.type=l}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ht(pt(t[1],e))}evaluate(t,e){return g(w(this._arg.evaluate(t,e)))}}function pt(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=ut.toString(t));break;case"number":"number"!==s&&(t=ut.toNumber(t));break;case"color":t=ut.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=gt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const gt={array:lt,boolean:lt,collator:null,format:null,image:null,literal:ct,number:lt,"number-format":null,object:lt,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,typeof:ht,accumulated:null,"feature-state":null,"geometry-type":b,id:v,"line-progress":null,properties:d,at:O,get:F,has:G,in:V,"index-of":D,length:H,slice:J,"!":N,"!=":M,"<":k,"<=":A,"==":$,">":j,">=":q,all:C,any:R,case:I,coalesce:L,match:U,within:null,interpolate:P,"interpolate-hcl":P,"interpolate-lab":P,step:S,let:B,var:T,concat:st,downcase:nt,"is-supported-script":null,"resolved-locale":null,upcase:nt,rgb:at,rgba:ot,"to-rgba":it,"-":W,"*":X,"/":Y,"%":Z,"^":tt,"+":et,abs:rt,acos:rt,asin:rt,atan:rt,ceil:rt,cos:rt,e:rt,floor:rt,ln:rt,ln2:rt,log10:rt,log2:rt,max:rt,min:rt,pi:rt,round:rt,sin:rt,sqrt:rt,tan:rt,zoom:x,"heatmap-density":null,"has-id":K,none:z};export{C as ALL,R as ANY,et as Add,lt as Assert,O as At,rt as Calculate,I as Case,L as Coalesce,ut as Coerce,st as Concat,Y as Div,$ as EQ,q as GE,j as GT,b as GeomType,F as Get,G as Has,K as HasID,v as ID,V as In,D as IndexOf,P as Interpolate,A as LE,k as LT,H as Length,B as Let,ct as Literal,U as Match,Z as Mod,X as Mul,M as NE,z as NONE,N as NOT,tt as Pow,d as Properties,at as Rgb,ot as Rgba,J as Slice,S as Step,nt as String,W as Sub,it as ToRgba,ht as TypeOf,T as Var,x as Zoom,pt as createExpression,gt as ops};
|
|
5
|
+
import t from"../../../../../Color.js";import{toLCH as e,toRGB as r,toLAB as s}from"../../../../../core/colorUtils.js";import{GeometryType as n}from"../../../../../geometry/support/TileClipper.js";import{unitBezier as a}from"../../../unitBezier.js";import{interpolate as o}from"../GeometryUtils.js";import{numberType as i,booleanType as l,colorType as u,stringType as c,valueToString as h,valueType as p,objectType as g,typeToString as f,arrayType as w,getType as m,matchType as y}from"./types.js";class _{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class v{constructor(){this.type=p}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new v}evaluate(t,e){return t?.id}}class b{constructor(){this.type=c}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new b}evaluate(t,e){if(!t)return null;switch(t.type){case n.Point:return"Point";case n.LineString:return"LineString";case n.Polygon:return"Polygon";default:return null}}}class d{constructor(){this.type=g}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new d}evaluate(t,e){return t?.values}}class x{constructor(){this.type=i}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new x}evaluate(t,e){return e}}class E{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=l}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new E(pt(t[1],e),pt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class $ extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t===e))}}class M extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t!==e))}}class k extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<e))}}class A extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t<=e))}}class j extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>e))}}class q extends E{static parse(t,e){return E.parse(t,e,((t,e)=>t>=e))}}class N{constructor(t){this._arg=t,this.type=l}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new N(pt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class C{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new C(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class R{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new R(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class z{constructor(t){this._args=t,this.type=l}static parse(t,e){const r=[];for(let s=1;s<t.length;s++)r.push(pt(t[s],e));return new z(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class I{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let s;const n=[];for(let o=1;o<t.length-1;o+=2){const a=pt(t[o],e),i=pt(t[o+1],e,r);s||(s=i.type),n.push({condition:a,output:i})}const a=pt(t[t.length-1],e,r);return s||(s=a.type),new I(s,n,a)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class L{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const s=[];for(let n=1;n<t.length;n++){const a=pt(t[n],e);r||(r=a.type),s.push(a)}return new L(r,s)}evaluate(t,e){for(const r of this._args){const s=r.evaluate(t,e);if(null!==s)return s}return null}}class U{constructor(t,e,r,s,n){this.type=t,this._input=e,this._labels=r,this._outputs=s,this._fallback=n}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const s=pt(t[1],e),n=[],a={};let o;for(let i=2;i<t.length-1;i+=2){let s=t[i];Array.isArray(s)||(s=[s]);for(const t of s){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(o){if(e!==o)throw new Error('"match" requires labels to have the same type')}else o=e;a[t]=n.length}const l=pt(t[i+1],e);r||(r=l.type),n.push(l)}return new U(r,s,a,n,pt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class P{constructor(t,e,r,s,n){this._operator=t,this.type=e,this.interpolation=r,this.input=s,this._stops=n}static parse(t,e,r){const s=t[0];if(t.length<5)throw new Error(`"${s}" expects at least 4 arguments`);const n=t[1];if(!Array.isArray(n)||0===n.length)throw new Error(`"${n}" is not a valid interpolation`);switch(n[0]){case"linear":if(1!==n.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==n.length||"number"!=typeof n[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==n.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=n[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${n[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const a=pt(t[2],e,i);let o;"interpolate-hcl"===s||"interpolate-lab"===s?o=u:r&&"value"!==r.kind&&(o=r);const l=[];for(let i=3;i<t.length;i+=2){const r=t[i];if("number"!=typeof r)throw new Error(`"${s}" requires stop inputs as literal numbers`);if(l.length&&l[l.length-1][0]>=r)throw new Error(`"${s}" requires strictly ascending stop inputs`);const n=pt(t[i+1],e,o);o||(o=n.type),l.push([r,n])}if(o&&o!==u&&o!==i&&("array"!==o.kind||o.itemType!==i))throw new Error(`"${s}" cannot interpolate type ${f(o)}`);return new P(s,o,n,a,l)}evaluate(n,a){const i=this._stops;if(1===i.length)return i[0][1].evaluate(n,a);const l=this.input.evaluate(n,a);if(l<=i[0][0])return i[0][1].evaluate(n,a);if(l>=i[i.length-1][0])return i[i.length-1][1].evaluate(n,a);let u=0;for(;++u<i.length&&!(l<i[u][0]););const c=i[u-1][0],h=i[u][0],p=P.interpolationRatio(this.interpolation,l,c,h),g=i[u-1][1].evaluate(n,a),w=i[u][1].evaluate(n,a);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(g)&&Array.isArray(w))return g.map(((t,e)=>o(t,w[e],p)));if("color"===this.type.kind&&g instanceof t&&w instanceof t){const e=new t(g),r=new t(w);return new t([o(e.r,r.r,p),o(e.g,r.g,p),o(e.b,r.b,p),o(e.a,r.a,p)])}if("number"===this.type.kind&&"number"==typeof g&&"number"==typeof w)return o(g,w,p);throw new Error(`"${this._operator}" cannot interpolate type ${f(this.type)}`)}if("interpolate-hcl"===this._operator){const s=e(g),n=e(w),a=n.h-s.h,i=r({h:s.h+p*(a>180||a<-180?a-360*Math.round(a/360):a),c:o(s.c,n.c,p),l:o(s.l,n.l,p)});return new t({a:o(g.a,w.a,p),...i})}if("interpolate-lab"===this._operator){const e=s(g),n=s(w),a=r({l:o(e.l,n.l,p),a:o(e.a,n.a,p),b:o(e.b,n.b,p)});return new t({a:o(g.a,w.a,p),...a})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let s=0;for(;++s<r.length&&!(t<r[s][0]););const n=r[s-1][0],a=r[s][0];return P.interpolationRatio(this.interpolation,e,n,a)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let s=0;for(;++s<e.length&&!(t<e[s][0]););return[e[s-1][0],e[s][0]]}static interpolationRatio(t,e,r,s){let n=0;if("linear"===t[0])n=P._exponentialInterpolationRatio(e,1,r,s);else if("exponential"===t[0])n=P._exponentialInterpolationRatio(e,t[1],r,s);else if("cubic-bezier"===t[0]){n=a(t[1],t[2],t[3],t[4])(P._exponentialInterpolationRatio(e,1,r,s),1e-5)}return n<0?n=0:n>1&&(n=1),n}static _exponentialInterpolationRatio(t,e,r,s){const n=s-r;if(0===n)return 0;const a=t-r;return 1===e?a/n:(e**a-1)/(e**n-1)}}class S{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=pt(t[1],e,i);let s;const n=[];n.push([-1/0,pt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(n.length&&n[n.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const o=pt(t[a+1],e);s||(s=o.type),n.push([r,o])}return new S(s,r,n)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let n=0;for(;++n<r.length&&!(s<r[n][0]););return this._stops[n-1][1].evaluate(t,e)}}class B{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const s=new _(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error(`"let" requires a string to define variable names - found ${r}`);s.add(r,pt(t[a+1],e))}const n=pt(t[t.length-1],s,r);return new B(n.type,n)}evaluate(t,e){return this._output.evaluate(t,e)}}class T{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const s=e.get(t[1]);if(!s)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new T(r||p,s)}evaluate(t,e){return this.output.evaluate(t,e)}}class O{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=pt(t[1],e,i),s=pt(t[2],e);return new O(s.type.itemType,r,s)}evaluate(t,e){const r=this._index.evaluate(t,e),s=this._array.evaluate(t,e);if(r<0||r>=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class F{constructor(t,e){this._key=t,this._obj=e,this.type=p}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new F(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new F(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return this._obj.evaluate(t,e)[r]}return t?.values[r]}}class G{constructor(t,e){this._key=t,this._obj=e,this.type=l}static parse(t,e){let r,s;switch(t.length){case 2:return r=pt(t[1],e),new G(r);case 3:return r=pt(t[1],e),s=pt(t[2],e),new G(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);if(this._obj){return r in this._obj.evaluate(t,e)}return!!t?.values[r]}}class V{constructor(t,e){this._key=t,this._vals=e,this.type=l}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new V(pt(t[1],e),pt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class D{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=pt(t[1],e),s=pt(t[2],e);if(4===t.length){const n=pt(t[3],e,i);return new D(r,s,n)}return new D(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const n=this._from.evaluate(t,e);if(n!==Math.floor(n))throw new Error('"index-of" index must be an integer');return s.indexOf(r,n)}return s.indexOf(r)}}class H{constructor(t){this._arg=t,this.type=i}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=pt(t[1],e);return new H(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class J{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=pt(t[1],e),s=pt(t[2],e,i);if(s.type!==i)throw new Error('"slice" index must return a number');if(4===t.length){const n=pt(t[3],e,i);if(n.type!==i)throw new Error('"slice" index must return a number');return new J(r.type,r,s,n)}return new J(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const n=this._to.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');return r.slice(s,n)}return r.slice(s)}}class K{constructor(){this.type=l}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new K}evaluate(t,e){return void 0!==t?.id}}class Q{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static parse(t,e,r){const s=t.slice(1).map((t=>pt(t,e)));return new Q(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class W extends Q{static parse(t,e){switch(t.length){case 2:return Q.parse(t,e,(t=>-t[0]));case 3:return Q.parse(t,e,(t=>t[0]-t[1]));default:throw new Error('"-" expects 1 or 2 arguments')}}}class X extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=1;for(const r of t)e*=r;return e}))}}class Y extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]/t[1]));throw new Error('"/" expects 2 arguments')}}class Z extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]%t[1]));throw new Error('"%" expects 2 arguments')}}class tt extends Q{static parse(t,e){if(3===t.length)return Q.parse(t,e,(t=>t[0]**t[1]));throw new Error('"^" expects 1 or 2 arguments')}}class et extends Q{static parse(t,e){return Q.parse(t,e,(t=>{let e=0;for(const r of t)e+=r;return e}))}}class rt{constructor(t,e){this._args=t,this._calculate=e,this.type=i}static{this.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])}}static parse(t,e){const r=t.slice(1).map((t=>pt(t,e)));return new rt(r,rt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map((r=>r.evaluate(t,e)))),this._calculate(r)}}class st{constructor(t){this._args=t,this.type=c}static parse(t,e){return new st(t.slice(1).map((t=>pt(t,e))))}evaluate(t,e){return this._args.map((r=>r.evaluate(t,e))).join("")}}class nt{constructor(t,e){this._arg=t,this._calculate=e,this.type=c}static{this.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()}}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=pt(t[1],e);return new nt(r,nt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}class at{constructor(t){this._args=t,this.type=u}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new at(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r));return new t({r:s,g:n,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class ot{constructor(t){this._args=t,this.type=u}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map((t=>pt(t,e)));return new ot(r)}evaluate(e,r){const s=this._validate(this._args[0].evaluate(e,r)),n=this._validate(this._args[1].evaluate(e,r)),a=this._validate(this._args[2].evaluate(e,r)),o=this._validateAlpha(this._args[3].evaluate(e,r));return new t({r:s,g:n,b:a,a:o})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class it{constructor(t){this._color=t,this.type=w(i,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=pt(t[1],e);return new it(r)}evaluate(e,r){return new t(this._color.evaluate(e,r)).toRgba()}}class lt{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,n=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":s=c;break;case"number":s=i;break;case"boolean":s=l;break;default:throw new Error('"array" type argument must be string, number or boolean')}n++}else s=p;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');n++}s=w(s,e)}else switch(r){case"string":s=c;break;case"number":s=i;break;case"boolean":s=l;break;case"object":s=g}const a=[];for(;n<t.length;n++){const r=pt(t[n],e);a.push(r)}return new lt(s,a)}evaluate(t,e){let r;for(const s of this._args){const n=s.evaluate(t,e);if(r=m(n),y(r,this.type))return n}throw new Error(`Expected ${f(this.type)} but got ${f(r)}`)}}class ut{static{this.types={"to-boolean":l,"to-color":u,"to-number":i,"to-string":c}}constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],s=ut.types[r];if(s===l||s===c){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const n=[];for(let a=1;a<t.length;a++){const r=pt(t[a],e);n.push(r)}return new ut(s,n)}evaluate(e,r){if(this.type===l)return Boolean(this._args[0].evaluate(e,r));if(this.type===c)return h(this._args[0].evaluate(e,r));if(this.type===i){for(const t of this._args){const s=Number(t.evaluate(e,r));if(!isNaN(s))return s}return null}if(this.type===u){for(const s of this._args)try{const n=ut.toColor(s.evaluate(e,r));if(n instanceof t)return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return h(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(e){if(e instanceof t)return e;if("string"==typeof e){const r=t.fromString(e);if(r)return r;throw new Error(`"${e}" is not a color`)}if(Array.isArray(e))return t.fromArray(e);throw new Error(`"${e}" is not a color`)}}class ct{constructor(t){this._val=t,this.type=m(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new ct(t[1])}evaluate(t,e){return this._val}}class ht{constructor(t){this._arg=t,this.type=c}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new ht(pt(t[1],e))}evaluate(t,e){return f(m(this._arg.evaluate(t,e)))}}function pt(t,e,r){const s=typeof t;if("string"===s||"boolean"===s||"number"===s||null===t){if(r)switch(r.kind){case"string":"string"!==s&&(t=ut.toString(t));break;case"number":"number"!==s&&(t=ut.toNumber(t));break;case"color":t=ut.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const n=t[0];if("string"!=typeof n)throw new Error("First element of expression must be a string");const a=gt[n];if(void 0===a)throw new Error(`Invalid expression operator "${n}"`);if(!a)throw new Error(`Unimplemented expression operator "${n}"`);return a.parse(t,e,r)}const gt={array:lt,boolean:lt,collator:null,format:null,image:null,literal:ct,number:lt,"number-format":null,object:lt,string:lt,"to-boolean":ut,"to-color":ut,"to-number":ut,"to-string":ut,typeof:ht,accumulated:null,"feature-state":null,"geometry-type":b,id:v,"line-progress":null,properties:d,at:O,get:F,has:G,in:V,"index-of":D,length:H,slice:J,"!":N,"!=":M,"<":k,"<=":A,"==":$,">":j,">=":q,all:C,any:R,case:I,coalesce:L,match:U,within:null,interpolate:P,"interpolate-hcl":P,"interpolate-lab":P,step:S,let:B,var:T,concat:st,downcase:nt,"is-supported-script":null,"resolved-locale":null,upcase:nt,rgb:at,rgba:ot,"to-rgba":it,"-":W,"*":X,"/":Y,"%":Z,"^":tt,"+":et,abs:rt,acos:rt,asin:rt,atan:rt,ceil:rt,cos:rt,e:rt,floor:rt,ln:rt,ln2:rt,log10:rt,log2:rt,max:rt,min:rt,pi:rt,round:rt,sin:rt,sqrt:rt,tan:rt,zoom:x,"heatmap-density":null,"has-id":K,none:z};export{C as ALL,R as ANY,et as Add,lt as Assert,O as At,rt as Calculate,I as Case,L as Coalesce,ut as Coerce,st as Concat,Y as Div,$ as EQ,q as GE,j as GT,b as GeomType,F as Get,G as Has,K as HasID,v as ID,V as In,D as IndexOf,P as Interpolate,A as LE,k as LT,H as Length,B as Let,ct as Literal,U as Match,Z as Mod,X as Mul,M as NE,z as NONE,N as NOT,tt as Pow,d as Properties,at as Rgb,ot as Rgba,J as Slice,S as Step,nt as String,W as Sub,it as ToRgba,ht as TypeOf,T as Var,x as Zoom,pt as createExpression,gt as ops};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{VTLMaterial as
|
|
5
|
+
import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as r}from"../../../../webgl/enums.js";import{VertexElementDescriptor as e}from"../../../../webgl/VertexElementDescriptor.js";class s extends t{static{this.ATTRIBUTES=[]}static{this.GEOMETRY_LAYOUT=[new e("a_pos",2,r.BYTE,0,2)]}static{this.ATTRIBUTES_INFO={}}constructor(t){super(t)}geometryInfo(){return s.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return s.ATTRIBUTES}attributesInfo(){return s.ATTRIBUTES_INFO}}export{s as VTLBackgroundMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EncodingType as r}from"./enums.js";import{VTLMaterial as e}from"./VTLMaterial.js";import{DataType as
|
|
5
|
+
import{EncodingType as r}from"./enums.js";import{VTLMaterial as e}from"./VTLMaterial.js";import{DataType as t}from"../../../../webgl/enums.js";import{VertexElementDescriptor as c}from"../../../../webgl/VertexElementDescriptor.js";class o extends e{static{this.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"]}static{this.GEOMETRY_LAYOUT=[new c("a_pos",2,t.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:r.R8_UNSIGNED},"circle-color":{name:"color",type:r.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:r.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:r.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:r.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:r.R8_UNSIGNED,precisionFactor:32}}}constructor(r){super(r)}geometryInfo(){return o.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return o.ATTRIBUTES}attributesInfo(){return o.ATTRIBUTES_INFO}}export{o as VTLCircleMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EncodingType as
|
|
5
|
+
import{EncodingType as t}from"./enums.js";import{VTLMaterial as o}from"./VTLMaterial.js";import{DataType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";class e extends o{static{this.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"fill-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:t.R16G16B16A16_PATTERN,isOptional:!0}}}constructor(t){super(t)}geometryInfo(){return e.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return e.ATTRIBUTES}attributesInfo(){return e.ATTRIBUTES_INFO}}class l extends o{static{this.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"]}static{this.ATTRIBUTES_FILL=["fill-color","fill-opacity"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,8),new r("a_offset",2,i.BYTE,4,8),new r("a_xnormal",2,i.BYTE,6,8)]}static{this.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100}}}static{this.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:t.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100}}}constructor(t,o){super(t),this._usefillColor=o}geometryInfo(){return l.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?l.ATTRIBUTES_FILL:l.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?l.ATTRIBUTES_INFO_FILL:l.ATTRIBUTES_INFO_OUTLINE}}export{e as VTLFillMaterial,l as VTLOutlineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EncodingType as e}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as
|
|
5
|
+
import{EncodingType as e}from"./enums.js";import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";class n extends t{static{this.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"]}static{this.GEOMETRY_LAYOUT=[new r("a_pos",2,i.SHORT,0,16),new r("a_extrude_offset",4,i.BYTE,4,16),new r("a_dir_normal",4,i.BYTE,8,16),new r("a_accumulatedDistance",2,i.UNSIGNED_SHORT,12,16)]}static{this.ATTRIBUTES_INFO={"line-width":{name:"width",type:e.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:e.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:e.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:e.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:e.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:e.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:e.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:e.R16G16B16A16_DASHARRAY,isOptional:!0}}}constructor(e){super(e)}geometryInfo(){return n.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return n.ATTRIBUTES}attributesInfo(){return n.ATTRIBUTES_INFO}}export{n as VTLLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../MemoryBuffer.js";import{EncodingType as e,AttributeStatus as n}from"./enums.js";import{DataType as o}from"../../../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class r{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,n,o,s){const r=this.getUniforms();for(const i of r){const{name:r,type:a,getValue:c}=i,u=c(n,e,o,s);if(null!==u)switch(a){case"float":t.setUniform1f(r,u);break;case"vec2":t.setUniform2fv(r,u);break;case"vec4":t.setUniform4fv(r,u)}}}encodeAttributes(t,n,o,s){const r=this.attributesInfo(),i=this.getEncodingInfos(),a=[];let c=0,u=0;for(const _ of Object.keys(i)){const
|
|
5
|
+
import t from"../MemoryBuffer.js";import{EncodingType as e,AttributeStatus as n}from"./enums.js";import{DataType as o}from"../../../../webgl/enums.js";import{VertexElementDescriptor as s}from"../../../../webgl/VertexElementDescriptor.js";class r{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,n,o,s){const r=this.getUniforms();for(const i of r){const{name:r,type:a,getValue:c}=i,u=c(n,e,o,s);if(null!==u)switch(a){case"float":t.setUniform1f(r,u);break;case"vec2":t.setUniform2fv(r,u);break;case"vec4":t.setUniform4fv(r,u)}}}encodeAttributes(t,n,o,s){const r=this.attributesInfo(),i=this.getEncodingInfos(),a=[];let c=0,u=0;for(const _ of Object.keys(i)){const h=i[_],{type:l,precisionFactor:f,isLayout:d}=r[_],y=d?o.getLayoutProperty(_):o.getPaintProperty(_),m=y.interpolator?.getInterpolationRange(n);let E=0;for(const o of h){const{offset:r,bufferElementsToAdd:i}=o;if(i>0){for(let t=0;t<i;t++)a.push(0);c+=u,u=o.bufferElementsToAdd}const _=s??y.getValue(m?m[E]:n,t);switch(l){case e.R8_SIGNED:case e.R8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r);break;case e.R16_SIGNED:case e.R16_UNSIGNED:a[c]|=this._encodeShort(_*(f||1),8*r);break;case e.R8G8_SIGNED:case e.R8G8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r),a[c]|=this._encodeByte(_*(f||1),8*r+8);break;case e.R16G16_SIGNED:case e.R16G16_UNSIGNED:a[c]|=this._encodeShort(_*(f||1),8*r),a[c]|=this._encodeShort(_*(f||1),8*r+16);break;case e.R8G8B8A8_SIGNED:case e.R8G8B8A8_UNSIGNED:a[c]|=this._encodeByte(_*(f||1),8*r),a[c]|=this._encodeByte(_*(f||1),8*r+8),a[c]|=this._encodeByte(_*(f||1),8*r+16),a[c]|=this._encodeByte(_*(f||1),8*r+24);break;case e.R8G8B8A8_COLOR:a[c]=this._encodeColor(_);break;case e.R16G16B16A16_DASHARRAY:case e.R16G16B16A16_PATTERN:this._encodePattern(c,a,_);break;default:throw new Error("Unsupported encoding type")}E++}}return a}getAtributeState(t){let e=0;const n=3+2*t;return e|=this._bit(n),e|=this._bit(n+1)<<1,e}static{this._encodingInfo={[e.R8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},[e.R16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},[e.R8G8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R8G8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},[e.R16G16_SIGNED]:{dataType:o.SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R16G16_UNSIGNED]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},[e.R8G8B8A8_SIGNED]:{dataType:o.BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_UNSIGNED]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},[e.R8G8B8A8_COLOR]:{dataType:o.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},[e.R16G16B16A16_DASHARRAY]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},[e.R16G16B16A16_PATTERN]:{dataType:o.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}}}_buildAttributesInfo(){const t=[],e={},s={};let i=-1;const a=this.attributesInfo(),c=this.attributes();let u=-1;for(const o of c){u++;const c=this.getAtributeState(u);if(c===n.UNIFORM||c===n.UNUSED)continue;const _=a[o],h=[];e[o]=h;const l=_.type;for(let e=0;e<c;e++){const{dataType:e,bytesPerElement:n,count:o,normalized:a}=r._encodingInfo[l],c=n*o,u=`${e}-${!0===a}`;let _=s[u],f=0;if(!_||_.count+o>4)i++,_={dataIndex:i,count:0,offset:0},4!==o&&(s[u]=_),t.push({location:-1,name:"a_data_"+i,count:o,type:e,normalized:a}),f=Math.ceil(Math.max(c/4,1));else{const e=t[_.dataIndex];e.count+=o;f=Math.ceil(Math.max(e.count*n/4,1))-Math.ceil(Math.max(_.offset/4,1))}h.push({dataIndex:_.dataIndex,offset:_.offset,bufferElementsToAdd:f}),_.offset+=c,_.count+=o}}for(const n of t)switch(n.type){case o.BYTE:case o.UNSIGNED_BYTE:n.count=4;break;case o.SHORT:case o.UNSIGNED_SHORT:n.count+=n.count%2}this._buildVertexBufferLayout(t);let _=0;const h=this._layout.get("geometry");for(const n of h)this._locations.set(n.name,_++);const l=this._layout.get("opacity");if(l)for(const n of l)this._locations.set(n.name,_++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,n=this.geometryInfo();let o=n[0].stride;if(0===t.length)e.set("geometry",n);else{const r=[];let a=o;for(const e of t)o+=i(e.type)*e.count;for(const t of n)r.push(new s(t.name,t.count,t.type,t.offset,o,t.normalized));for(const e of t)r.push(new s(e.name,e.count,e.type,a,o,e.normalized)),a+=i(e.type)*e.count;e.set("geometry",r)}const r=this.opacityInfo();r&&e.set("opacity",r),this._layout=e,this._stride=o}_buildShaderInfo(t,o){let s="\n",i="\n";const c=[];for(const e of t)s+=`attribute ${this._getType(e.count)} ${e.name};\n`;const u=this.attributes(),_=this.attributesInfo();let h=-1;for(const l of u){h++;const{name:t,type:u,precisionFactor:f,isLayout:d}=_[l],y=f&&1!==f?" * "+1/f:"",{bytesPerElement:m,count:E}=r._encodingInfo[u],I=t=>`a_data_${t.dataIndex}${a(E,t.offset,m)}`;switch(this.getAtributeState(h)){case n.UNIFORM:{const n=this._getType(E),o=`u_${t}`;c.push({name:o,type:n,getValue:(t,n,o,s)=>{const r=d?t.getLayoutValue(l,n):t.getPaintValue(l,n);if(u===e.R16G16B16A16_DASHARRAY){const e=t.getDashKey(r,t.getLayoutValue("line-cap",n)),o=s.getMosaicItemPosition(e,!1);if(null==o)return null;const{tl:i,br:a}=o;return[i[0],a[1],a[0],i[1]]}if(u===e.R16G16B16A16_PATTERN){const t=s.getMosaicItemPosition(r,!l.includes("line-"));if(null==t)return null;const{tl:e,br:n}=t;return[e[0],n[1],n[0],e[1]]}if(u===e.R8G8B8A8_COLOR){const t=r[3];return[t*r[0],t*r[1],t*r[2],t]}return r}}),s+=`uniform ${n} ${o};\n`,i+=`${n} ${t} = ${o};\n`}break;case n.DATA_DRIVEN:{const e=I(o[l][0]);i+=`${this._getType(E)} ${t} = ${e}${y};\n`}break;case n.INTERPOLATED_DATA_DRIVEN:{const e=`u_t_${t}`;c.push({name:e,type:"float",getValue:(t,e,n,o)=>(d?t.getLayoutProperty(l):t.getPaintProperty(l)).interpolator.interpolationUniformValue(n,e)}),s+=`uniform float ${e};\n`;const n=I(o[l][0]),r=I(o[l][1]);i+=`${this._getType(E)} ${t} = mix(${n}${y}, ${r}${y}, ${e});\n`}}}this._shaderHeader=s,this._shaderMain=i,this._uniforms=c}_bit(t){return(this._key&1<<t)>>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(e){const n=255*e[3];return t.i8888to32(e[0]*n,e[1]*n,e[2]*n,n)}_encodePattern(t,e,n){if(!n?.rect)return;const o=2,s=n.rect,r=n.width,i=n.height;e[t]=this._encodeShort(s.x+o,0),e[t]|=this._encodeShort(s.y+o+i,16),e[t+1]=this._encodeShort(s.x+o+r,0),e[t+1]|=this._encodeShort(s.y+o,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}const i=t=>{switch(t){case o.FLOAT:case o.INT:case o.UNSIGNED_INT:return 4;case o.SHORT:case o.UNSIGNED_SHORT:case o.HALF_FLOAT:return 2;case o.BYTE:case o.UNSIGNED_BYTE:return 1}},a=(t,e,n)=>{const o=e/n;if(1===t)switch(o){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(2===t)switch(o){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(3===t)switch(o){case 0:return".xyz";case 1:return".yzw"}return""};export{r as VTLMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{EncodingType as
|
|
5
|
+
import{EncodingType as t}from"./enums.js";import{VTLMaterial as o}from"./VTLMaterial.js";import{DataType as e}from"../../../../webgl/enums.js";import{VertexElementDescriptor as r}from"../../../../webgl/VertexElementDescriptor.js";const i=[new r("a_pos",2,e.SHORT,0,16),new r("a_vertexOffset",2,e.SHORT,4,16),new r("a_texAngleRange",4,e.UNSIGNED_BYTE,8,16),new r("a_levelInfo",4,e.UNSIGNED_BYTE,12,16)],a=[new r("a_opacityInfo",1,e.UNSIGNED_BYTE,0,1)];class n extends o{static{this.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"]}static{this.ATTRIBUTES_INFO={"icon-color":{name:"color",type:t.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:t.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:t.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:t.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:t.R8_UNSIGNED,precisionFactor:32,isLayout:!0}}}constructor(t){super(t)}geometryInfo(){return i}opacityInfo(){return a}attributes(){return n.ATTRIBUTES}attributesInfo(){return n.ATTRIBUTES_INFO}}class c extends o{static{this.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"]}static{this.ATTRIBUTES_INFO={"text-color":{name:"color",type:t.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:t.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:t.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:t.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:t.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:t.R8_UNSIGNED,isLayout:!0}}}constructor(t){super(t)}geometryInfo(){return i}opacityInfo(){return a}attributes(){return c.ATTRIBUTES}attributesInfo(){return c.ATTRIBUTES_INFO}}export{n as VTLIconMaterial,c as VTLTextMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{CapType as e,JoinType as t}from"../../../../../symbols/cim/enums.js";var a,
|
|
5
|
+
import{CapType as e,JoinType as t}from"../../../../../symbols/cim/enums.js";var i,a,n,l,u,m,o,r,p;!function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.FILL=1]="FILL",e[e.LINE=2]="LINE",e[e.SYMBOL=3]="SYMBOL",e[e.CIRCLE=4]="CIRCLE"}(i||(i={})),function(e){e[e.VISIBLE=0]="VISIBLE",e[e.NONE=1]="NONE"}(a||(a={})),function(e){e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.LINE_CENTER=2]="LINE_CENTER"}(n||(n={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT",e[e.AUTO=2]="AUTO"}(l||(l={})),function(e){e[e.AUTO=0]="AUTO",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT"}(u||(u={})),function(e){e[e.CENTER=0]="CENTER",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.TOP=3]="TOP",e[e.BOTTOM=4]="BOTTOM",e[e.TOP_LEFT=5]="TOP_LEFT",e[e.TOP_RIGHT=6]="TOP_RIGHT",e[e.BOTTOM_LEFT=7]="BOTTOM_LEFT",e[e.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(m||(m={})),function(e){e[e.NONE=0]="NONE",e[e.UPPERCASE=1]="UPPERCASE",e[e.LOWERCASE=2]="LOWERCASE"}(o||(o={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT"}(r||(r={})),function(e){e[e.HORIZONTAL=0]="HORIZONTAL",e[e.VERTICAL=1]="VERTICAL"}(p||(p={}));class f{static{this.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:e.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:t.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}}}static{this.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:n.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:m.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:u.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:l.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:o.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[p.HORIZONTAL]}}}static{this.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:a.VISIBLE}}}static{this.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}}}static{this.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}static{this.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"line-width":{type:"number",minimum:0,default:1}}}static{this.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}static{this.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}}}static{this.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:r.MAP}}}}export{l as RotationAlignment,f as StyleDefinition,i as StyleLayerType,m as SymbolAnchor,n as SymbolPlacement,u as TextJustification,o as TextTransform,p as TextWritingMode,r as TranslateAnchor,a as Visibility};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{AttributeDataType as i,filterFlagsUnit as s,animationUnit as r,gpgpuUnit as a,localTimeOriginUnit as n,visualVariableUnit as u,dataDrivenUnit0 as h,dataDrivenUnit1 as o,dataDrivenUnit2 as l}from"./definitions.js";import{getDisplayIdTexel as d}from"./DisplayId.js";import{getPixelArrayCtor as g,getPixelBytes as _}from"./Utils.js";import{TextureWrapMode as p,TextureSamplingMode as c}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=g(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=p.CLAMP_TO_EDGE,t.samplingMode=c.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=d(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=d(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,l=h,d=this.size,_=o,p=h*this.size*u,c=(d+_*this.size)*u-p,x=g(this.pixelType),f=new x(a,p*x.BYTES_PER_ELEMENT,c),b=this.size,m=_-l+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,l,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=g(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=_(r),h=new(g(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.getBoundFramebufferObject(),{x:l,y:d,width:p,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(l,d,p,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,i.FilterFlags,1,e)}setLocalTimeOrigin(t,e){this.setData(t,i.LocalTimeOrigin,0,e)}getLabelMinZoom(t){return this.getData(t,i.FilterFlags,1,255)}getFilterFlags(t){return this.getData(t,i.FilterFlags,0,0)}getVisualVariableData(t,e){return this.getData(t,i.VV,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,i.FilterFlags),unit:s},animation:{texture:this._getTexture(t,i.Animation),unit:r},gpgpu:{texture:this._getTexture(t,i.GPGPU),unit:a},localTimeOrigin:{texture:this._getTexture(t,i.LocalTimeOrigin),unit:n},visualVariableData:{texture:this._getTexture(t,i.VV),unit:u},dataDriven0:{texture:this._getTexture(t,i.DD0),unit:h},dataDriven1:{texture:this._getTexture(t,i.DD1),unit:o},dataDriven2:{texture:this._getTexture(t,i.DD2),unit:l},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=p.CLAMP_TO_EDGE,e.samplingMode=c.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
|
|
5
|
+
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{AttributeDataType as i,filterFlagsUnit as s,animationUnit as r,gpgpuUnit as a,localTimeOriginUnit as n,visualVariableUnit as u,dataDrivenUnit0 as h,dataDrivenUnit1 as o,dataDrivenUnit2 as l}from"./definitions.js";import{getDisplayIdTexel as d}from"./DisplayId.js";import{getPixelArrayCtor as g,getPixelBytes as _}from"./Utils.js";import{TextureWrapMode as p,TextureSamplingMode as c}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=g(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=p.CLAMP_TO_EDGE,t.samplingMode=c.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=d(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=d(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,l=h,d=this.size,_=o,p=h*this.size*u,c=(d+_*this.size)*u-p,x=g(this.pixelType),f=new x(a,p*x.BYTES_PER_ELEMENT,c),b=this.size,m=_-l+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,l,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=g(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=_(r),h=new(g(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.getBoundFramebufferObject(),{x:l,y:d,width:p,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(l,d,p,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}get locked(){return this._locked}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,i.FilterFlags,1,e)}setLocalTimeOrigin(t,e){this.setData(t,i.LocalTimeOrigin,0,e)}getLabelMinZoom(t){return this.getData(t,i.FilterFlags,1,255)}getFilterFlags(t){return this.getData(t,i.FilterFlags,0,0)}getVisualVariableData(t,e){return this.getData(t,i.VV,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,i.FilterFlags),unit:s},animation:{texture:this._getTexture(t,i.Animation),unit:r},gpgpu:{texture:this._getTexture(t,i.GPGPU),unit:a},localTimeOrigin:{texture:this._getTexture(t,i.LocalTimeOrigin),unit:n},visualVariableData:{texture:this._getTexture(t,i.VV),unit:u},dataDriven0:{texture:this._getTexture(t,i.DD0),unit:h},dataDriven1:{texture:this._getTexture(t,i.DD1),unit:o},dataDriven2:{texture:this._getTexture(t,i.DD2),unit:l},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=p.CLAMP_TO_EDGE,e.samplingMode=c.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"./DisplayRecord.js";import{serializeList as
|
|
5
|
+
import t from"./DisplayRecord.js";import{serializeList as i,deserializeList as r}from"./util/serializationUtils.js";class s{static{this.byteSizeHint=2*Uint32Array.BYTES_PER_ELEMENT+t.byteSizeHint}constructor(t,i){this.id=t,this.sortKey=i,this.records=[]}serialize(t){return t.push(this.id),t.writeF32(this.sortKey),i(t,this.records),t}static deserialize(i){const e=i.readInt32(),o=i.readF32(),a=new s(e,o);return a.records=r(i,t)??[],a}}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{constructor(t,e,s,r,
|
|
5
|
+
class t{static{this.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT}constructor(t,e,s,i,r,h,n){this.instanceId=t,this.textureKey=e,this.indexStart=s,this.indexCount=i,this.vertexStart=r,this.vertexCount=h,this.overlaps=n}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new t(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,s,i,r,h,n,a){t.push(e),t.push(s),t.push(i),t.push(r),t.push(h),t.push(n),t.push(a)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(e){const s=e.readInt32(),i=e.readInt32(),r=e.readInt32(),h=e.readInt32(),n=e.readInt32(),a=e.readInt32(),u=e.readInt32();return new t(s,i,r,h,n,a,u)}}export{t as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../../core/has.js";import"../../../../webgl/checkWebGLError.js";import{Usage as r}from"../../../../webgl/enums.js";import"../../../../webgl/GLObjectType.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";class o{constructor(t,s){this._boundPart=null,this.vertexBuffers=new Map,this.indexBuffers=new Map,this.groups=[];for(const o in s.vertex){const{data:i,attributes:n}=s.vertex[o],f=e.createVertex(t,r.STATIC_DRAW,i);this.vertexBuffers.set(o,{buffer:f,attributes:n})}for(const
|
|
5
|
+
import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../../core/has.js";import"../../../../webgl/checkWebGLError.js";import{Usage as r}from"../../../../webgl/enums.js";import"../../../../webgl/GLObjectType.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";class o{constructor(t,s){this._boundPart=null,this.vertexBuffers=new Map,this.indexBuffers=new Map,this.groups=[];for(const o in s.vertex){const{data:i,attributes:n}=s.vertex[o],f=e.createVertex(t,r.STATIC_DRAW,i);this.vertexBuffers.set(o,{buffer:f,attributes:n})}for(const o in s.index){const{data:i}=s.index[o],n=e.createIndex(t,r.STATIC_DRAW,i);this.indexBuffers.set(o,{buffer:n})}for(const e of s.groups)this.groups.push({...e,vertexArrays:new Map});this.parts=s.parts}bind(e,r,s){this._boundPart=s;const{group:o}=this.parts[this._boundPart],i=this.groups[o];if(!i)throw new Error(`Missing group ${o}.`);let n=i.vertexArrays.get(r.stringHash);if(!n){const s=new Set(r.locations.keys()),o=i.index?this.indexBuffers.get(i.index)?.buffer:null,f=new Map,u=new Map;for(const[e,{buffer:r,attributes:t}]of this.vertexBuffers){const o=t.filter((e=>s.has(e.name)));o.length>0&&(f.set(e,o),u.set(e,r))}n=new t(e,r.locations,f,u,o),i.vertexArrays.set(r.stringHash,n)}e.bindVAO(n)}draw(e){if(null==this._boundPart)throw new Error("Mesh.bind() has not been called.");const{start:r,count:t}=this.parts[this._boundPart],{group:o}=this.parts[this._boundPart],{primitive:i,index:n}=this.groups[o];if(n){const o=this.indexBuffers.get(n);if(!o)throw new Error(`Missing index buffer "${n}".`);const{indexType:f}=o.buffer;if(!f)throw new Error("Buffer type error.");e.drawElements(i,t,f,r*s[f])}else e.drawArrays(i,r,t)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArrays:e}of this.groups)for(const[r,t]of e)t.disposeVAOOnly();for(const{buffer:e}of this.vertexBuffers.values())e.dispose();for(const{buffer:e}of this.indexBuffers.values())e.dispose()}}export{o as Mesh};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",n)],C.prototype,"glVertexID",void 0);class I{}class v{static{this.builtins=[]}}t([b("gl_FragCoord",s)],v.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],v.prototype,"glPointCoord",void 0);class w{}t([l("gl_FragDepth")],w.prototype,"glFragDepth",void 0);class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new c(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new c("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(i,y),h=this._hydrateFragmentInput(d),f=this.fragment(h),l=new Set;for(const p in f){const t=f[p];u(l,t)}const m=this._getVertexInputBuiltins(),g=a.createVertex({...s,...c},d,m,n,this.transformFeedbackBindings,l);(new p).write(g);const _=this._getFragmentInputBuiltins(f);_.set("glPointCoord","gl_PointCoord");const K=a.createFragment(h,f,_,n,g,this.transformFeedbackBindings);(new p).write(K);const x=this._createShaderBuilder(g,K),b=x.generate("vertex"),C=x.generate("fragment");return this.logShader&&(console.log(b),console.log(C)),{vertex:b,fragment:C,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new y;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,C as VertexInput,l as builtin,K as define,m as input,f as location,_ as option,x as transformFeedback,g as uniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function t(t){return t.split(" ").map(((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t)).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}
|
|
5
|
+
function t(t){return t.split(" ").map(((t,e)=>e>0?t.charAt(0).toUpperCase()+t.slice(1):t)).join("")}function e(t,e){const s=[];for(s.push(e);s.length;){const e=s.pop();if("object"==typeof e&&!t.has(e.uid)){t.add(e.uid);for(const t of e.children)s.push(t)}}}class s{constructor(){this.uid=s.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}static{this.NodeCount=0}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=t(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof s&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(t){t._debugName=this._debugName,t._isMutable=this._isMutable,t.isImplicit=this.isImplicit,t.uid=this.uid}}function i(t){return"object"==typeof t?t.clone():t}class r extends s{constructor(){super(...arguments),this.shaderType="primitive-node"}}class n extends s{constructor(t){super(),this.child=t,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const t=new n(i(this.child));return this.cloneInto(t),t}}class h extends s{constructor(t){super(),this.text=t,this.shaderType="text-node"}get children(){return[]}clone(){const t=new h(this.text);return this.cloneInto(t),t}}class c extends s{constructor(t,e,s){super(),this.property=t,this.target=e,this.returnType=s,this.shaderType="property-access-node"}get children(){const t=[this.target];return"string"!=typeof this.property&&t.push(this.property),t}clone(){const t=new c(this.property,i(this.target),this.returnType);return this.cloneInto(t),t}}class o extends s{constructor(t,e,s,i){super(),this.x=t,this.y=e,this.target=s,this.returnType=i,this.shaderType="property-access-2d-node"}get children(){return[this.target,this.x,this.y]}clone(){const t=new o(this.x,this.y,i(this.target),this.returnType);return this.cloneInto(t),t}}class u extends s{constructor(t,e,s){super(),this.condition=t,this.ifTrue=e,this.ifFalse=s,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const t=i(this.ifTrue),e=this.ifFalse?i(this.ifFalse):null,s=new u(this.condition,t,e);return this.cloneInto(s),s}}class p extends s{constructor(t,e,s,i){super(),this.captureList=t,this.returnType=e,this.generator=i,this.shaderType="block-node",s&&(this.subgraph=new n(s))}get children(){return Object.keys(this.captureList).map((t=>this.captureList[t])).concat(this.subgraph??[])}clone(){const t={};for(const s in this.captureList)t[s]=i(this.captureList[s]);const e=new p(t,this.returnType,this.subgraph?i(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(e),e}}class a extends s{constructor(t,e,s,i,r,n=!1){super(),this.token=t,this._children=e,this.isInfix=s,this.isPropertyAccess=i,this.returnType=r,this.isTernary=n,this.shaderType="function-node"}get children(){return this._children}clone(){const t=new a(this.token,this._children.map(i),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(t),t}}export{p as ShaderBlockNode,u as ShaderConditionNode,a as ShaderFunctionNode,s as ShaderNode,r as ShaderPrimitiveNode,o as ShaderPropertyAccess2DNode,c as ShaderPropertyAccessNode,n as ShaderScopeNode,h as ShaderTextNode,i as cloneShaderNode,e as setReachableUids};
|